<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<title>订单列表</title>
	<script src="/static/mobile/js/mui.min.js"></script>
	<link href="/static/mobile/css/mui.min.css" rel="stylesheet"/>
	<link rel="stylesheet" type="text/css" href="/static/mobile/css/basic.css"/>
	<link rel="stylesheet" type="text/css" href="/static/mobile/css/dingdan.css"/>
	<script type="text/javascript" src="/static/mobile/js/jquery.js"></script>
	<script type="text/javascript" charset="utf-8">
		mui.init();
	</script>
</head>
<body>
<div class="sectionx">
	<header class="mui-bar mui-bar-nav" >
		<a class="mui-icon mui-icon-left-nav mui-pull-left" href="javascript:history.back(-1)" style="color: #4E4E4E;"></a>
		<h1 class="mui-title">订单</h1>
	</header>
</div>
<div class="section2">
	<div class="container mui-clearfix">
		<ul class="zxcv">

			<li style="width: 25%" {eq name="select" value="1"} class="select" 	{/eq}><a href="{:url('dingdan',array('is_ok'=>1))}"><span>待付款</span></a></li>


			<li style="width: 25%" {eq name="select" value="2"} class="select" 	{/eq}><a href="{:url('dingdan',array('is_ok'=>2))}"><span>待发货</span></a></li>


			<li style="width: 25%" {eq name="select" value="3"} class="select" {/eq}><a href="{:url('dingdan',array('is_ok'=>3))}"><span>待收货</span></a></li>


			<li style="width: 25%" {eq name="select" value="4"}class="select" {/eq}><a href="{:url('dingdan',array('is_ok'=>4))}"><span>待评论</span></a></li>


		</ul>
	</div>
</div>
<div class="section3">
	<div class="section_Y">
		<?php if(empty($lists)){
				?>
		<div class="section3-1" style="text-align: center">
			未有订单
		</div>
		<?php
			}else{
			?>
		{volist name='lists' id='value'}
		<div class="section3-1">
			<div class="yy mui-clearfix">
				<div class="yy-1">
					<img src="{$value.shop_id|order_img}"/>
				</div>
				<div class="yy-2">
					<p class="p1">名称{$value.shop_id|order_title}</p>
					<p class="p2">
						<span class="s1">订单编号{$value.danhao}</span>
					</p>
				</div>
				<div class="yy-3">
					<p class="p1">¥{$value.shop_id|order_price}</p>
					<!--<p class="p2"><s>¥ 50.00</s></p>-->
					<p class="p3">×{$value.num}</s></p>
				</div>
			</div>
			<div class="xx">
				<p> 合计：<span>¥ {$value.xiaofei}</span></p>
			</div>
			{eq name="$value.is_ok" value="1"}
			<div class="zz">
				<a href="{:url('user/set/del_order')}?id={$value.id}" class="s1">取消订单</a><a href="{:url('user/shop/buy')}?id={$value.shop_id}&num={$value.num}" class="s2">去付款</a>
			</div>
			{/eq}
			{eq name="$value.is_ok" value="2"}
			<div class="zz">
				<a href="javascript:void(0);" class="s1">已支付</a>
			</div>
			{/eq}
			{eq name="$value.is_ok" value="5"}
			<div class="zz">
				<a href="javascript:void(0);" class="s1">商家已取消</a>
			</div>
			{/eq}
			{eq name="$value.is_ok" value="3"}
			<div class="zz">
				<a onclick="return commints('{$value.id}');" class="s2">确认收货</a>
			</div>
			{/eq}
			{eq name="$value.is_ok" value="4"}
			<div class="zz">
				<a href="{:url('user/shop/pinglun')}?id={$value.shop_id}&num={$value.num}" class="s2">去评价</a>
			</div>
			{/eq}
			<div class="ge"></div>
		</div>
		{/volist}
		<?php }?>
	</div>

</div>
{$page|raw}
</body>
<script src="/static/plugins/layui/layui.js"></script>
<script type="text/javascript">
	$(function(){
		$(".zxcv li").click(function(){
			$(this).addClass("select").siblings().removeClass("select");
			var dd = $(this).index();
			$(".section_Y").eq(dd).show().siblings().hide();
		})
	})
</script>
<script>
	function commints(id){
		$.ajax({
			type : "POST",  //请求方式
			async:false,
			url : "{:url('user/shop/qurenshouhuo')}",  //请求路径
			dataType:"html",
			data :'id='+id,
			success : function(msg){  //异步请求成功执行的回调函数
				var jsonParseJson=JSON.parse(msg);
				if(jsonParseJson['success']==1){
					layer.msg(jsonParseJson['msg'],{time:1000,icon:1},function(){
						location.href = "{:url('dingdan',array('is_ok'=>3))}";
					});
				}else{
					layer.msg(jsonParseJson['msg'],{time:1000,icon:2});
				}

			}
		});
	}
	layui.use(['form', 'layer'], function () {

	})
</script>

</html>